<!-- include tpl=head title='会员注册：第一步填写邮箱取得注册资格' -->
<script type="text/javascript">
$(document).ready(function(){
	$('#register_form_submit').submit(function(){
		$(this).ajaxSubmit({
			'url':api_url('email','register'),
			'type':'post',
			'dataType':'json',
			'success':function(rs){
				if(rs.status == 'ok'){
					$.dialog.alert("请登录您的邮箱获取注册资格");
				}else{
					if(!rs.content){
						rs.content = '验证失败';
					}
					$.dialog.alert(rs.content);
				}
			}
		});
		return false;
	});
});
//更新会员组
function update_group(gid)
{
	$.phpok.go(get_url('register','','group_id='+gid));
}
</script>
<div class="login-reg">
	<dl class="box">
		<dt>填写您的邮箱，获取验证串</dt>
		<form method="post" id="register_form_submit">
		<!-- if $grouplist -->
		<dd>
			<label>会员组：</label>
			<select name="group_id" id="group_id" onchange="update_group(this.value)">
				<!-- loop from=$grouplist key=$key value=$value -->
				<option value="{$value.id}"{if $value.id == $group_id} selected{/if}>{$value.title}</option>
				<!-- /loop -->
			</select>
			<div class="clear"></div>
		</dd>
		<!-- else -->
		<input type="hidden" name="group_id" value="{$group_id}" />
		<!-- /if -->
		<dd>
			<label>邮箱：</label>
			<input class="input" type="text" name="email" id="email" />
			<div class="clear"></div>
		</dd>
		<!-- if $is_vcode -->
		<dd>
			<label>验证码：</label>
			<input class="vcode"  type="text" id="_chkcode" name="_chkcode" />
			<img src="" border="0" align="absmiddle" id="update_vcode" class="hand" />
			<div class="clear"></div>
		</dd>
		<script type="text/javascript">
		$(document).ready(function(){
			$("#update_vcode").phpok_vcode();
			//更新点击时操作
			$("#update_vcode").click(function(){
				$(this).phpok_vcode();
			});
		});
		</script>
		<!-- /if -->
		<dd class="submit"><input class="button blue" type="submit" value="获取注册资格" name=""></dd>
		</form>
	</dl>
	<dl class="box"><!-- include tpl=block/protocol --></dl>
	<div class="clear"></div>
</div>
<!-- include tpl=foot -->